// BackToCity.cpp : implementation file
//

#include "stdafx.h"
#include "GameCore.h"
#include "BackToCity.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBackToCity dialog


CBackToCity::CBackToCity(CWnd* pParent /*=NULL*/)
	: CDialog(CBackToCity::IDD, pParent)
{
	//{{AFX_DATA_INIT(CBackToCity)
	m_bUseLeft = FALSE;
	m_iUseLeftValue = 0;
	m_bUseBlood = FALSE;
	m_iUseBloodValue = 0;
	//}}AFX_DATA_INIT
}


void CBackToCity::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBackToCity)
	DDX_Check(pDX, IDC_CHECK_BackPack_Last, m_bUseLeft);
	DDX_Text(pDX, IDC_EDIT_BackPack_Last, m_iUseLeftValue);
	DDX_Check(pDX, IDC_CHECK_Add_Blood, m_bUseBlood);
	DDX_Text(pDX, IDC_EDIT_Add_Blood, m_iUseBloodValue);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CBackToCity, CDialog)
	//{{AFX_MSG_MAP(CBackToCity)
	ON_BN_CLICKED(IDC_BTN__RELIVE_POINT_Record, OnBTNRELIVEPOINTRecord)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBackToCity message handlers
 

BOOL CBackToCity::ReLoadInfo()
{
	if(this->m_bIsLoaded) return FALSE;
	IninDataInfo();
	__super::ReLoadInfo();
	return TRUE;
}

BOOL CBackToCity::SaveInfo()
{
	UpdateData();
	BackCityConfig* info=&g_lpConfigManager->m_ParamsSaveConfig.m_stBackCityConfig;
	info->m_bUseBlood=m_bUseBlood;
	info->m_bUseLeft=m_bUseLeft;
	info->m_iUseBloodValue=m_iUseBloodValue;
	info->m_iUseLeftValue=m_iUseLeftValue;
	return TRUE;
}

BOOL CBackToCity::IninDataInfo()
{
	UpdateData();
	BackCityConfig* info=&g_lpConfigManager->m_ParamsConfig.m_stBackCityConfig;
	m_bUseBlood=info->m_bUseBlood;
	m_bUseLeft=info->m_bUseLeft;
	m_iUseBloodValue=info->m_iUseBloodValue;
	m_iUseLeftValue=info->m_iUseLeftValue;
	UpdateData(FALSE);
	return TRUE;
}

BOOL CBackToCity::ShowDlg()
{
	this->ShowWindow(1); 
	this->BringWindowToTop();
	return TRUE;
}


BOOL CBackToCity::HiddenDlg()
{
	this->ShowWindow(0); 
	return TRUE;
}


BOOL CBackToCity::SetDlgItemLanguage()
{
	return TRUE;
}


BOOL CBackToCity::OnInitDialog() 
{
	CDialog::OnInitDialog();
	//this->ReLoadInfo(); 
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CBackToCity::OnBTNRELIVEPOINTRecord() 
{
	// TODO: Add your control notification handler code here
	
}
